package thefirst.controller;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import thefirst.addresscode.model.AddressCodeService;
import thefirst.addresscode.model.AddressCodeVO;

@Controller
public class AddressCodeController {
	@Resource(name="addressCodeServiceImpl")
	private AddressCodeService addressCodeService;
	@RequestMapping("/findAddressByZipcode.do")
	@ResponseBody
	public List<AddressCodeVO> findAddressByZipcode(String dong) throws SQLException{
		System.out.println("dong:"+dong);
		List<AddressCodeVO> list=addressCodeService.findAddressByZipcode(dong);
		System.out.println("address:"+list);
		return list;
	}

}
